<%--
  Created by IntelliJ IDEA.
  User: 15154
  Date: 2020/10/10
  Time: 15:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>用户管理</title>
    <link rel="stylesheet" href="${pageContext.servletContext.contextPath}/resources/layui/css/layui.css">

</head>
<body>

<img style="width: 200px;height: 50px;" src="${pageContext.servletContext.contextPath}/resources/images/img.png">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>我的信息</legend>
</fieldset>
<div class="layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>用户信息如下</th>
            <th></th>
        </tr>
        </thead>
        <tbody id="body">

        </tbody>
    </table>
</div>

<script src="${pageContext.servletContext.contextPath}/resources/layui/layui.js"></script>
<script type="text/javascript">
    layui.use([ 'jquery', 'layer', 'form', 'table','laydate' ], function() {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var laydate=layui.laydate;

        $.get({
            url:'/selectStudent/${sessionScope.stuNumber}',
            dataType : "json",//数据格式
            async : false,//是否异步请求
            success : function(data) {   //如何发送成功
                var html = "";
                html+=
                "<tr>"+
                "<td>"+"学号"+"</td>"+
                "<td>"+data.stuNumber+"</td>"+
                "</tr>"+
                    "<tr>"+
                    "<td>"+"用户名"+"</td>"+
                    "<td>"+data.stuName+"</td>"+
                    "</tr>"+
                    "<tr>"+
                    "<td>"+"密码"+"</td>"+
                    "<td>"+data.passWord+"</td>"+
                    "</tr>"+
                    "<tr>"+
                    "<td>"+"楼栋号"+"</td>"+
                    "<td>"+data.buildNumber+"</td>"+
                    "</tr>"+
                    "<tr>"+
                    "<td>"+"剩余积分"+"</td>"+
                    "<td>"+data.money+"</td>"+
                    "</tr>"+
                    "<tr>"+
                    "<td>"+"电话"+"</td>"+
                    "<td>"+data.tel+"</td>"+
                    "</tr>";
                $("#body").html(html);
            }
        });

        //绑定时间选择器
        laydate.render({
            elem:'#startTime'
        });
        laydate.render({
            elem:'#endTime'
        });


    });
</script>
</body>
</html>
